FROM centos:7
RUN yum -y install make && \
    yum -y install gcc && \
    yum -y install vim
RUN groupadd player
RUN useradd player -ms/bin/bash -g player && \
    echo "player:player" | chpasswd && \
    echo "root:toor" | chpasswd


ENV CUBE_PATH="/root/centoscloud/cube-1.3" \
    CUBELIBPATH="/root/centoscloud/cube-1.3/cubelib" \
    CUBESYSPATH="/root/centoscloud/cube-1.3/proc" \
    LD_LIBRARY_PATH="/root/centoscloud/cube-1.3/cubelib/lib" \
    CUBE_BASE_DEFINE="/root/centoscloud/cube-1.3/proc/main/base_define" \
    CUBE_DEFINE_PATH="/root/centoscloud/cube-1.3/proc/define" \
    CUBE_SYS_PLUGIN="/root/centoscloud/cube-1.3/proc/plugin"
ADD cube-1.3 /root/centoscloud/cube-1.3
RUN chmod 755 /root/
RUN chmod 755 /root/centoscloud/
RUN chmod 755 -R /root/centoscloud/cube-1.3
WORKDIR /root/centoscloud/cube-1.3/

RUN echo "export CUBE_PATH=/root/centoscloud/cube-1.3" >> /home/player/.bashrc
RUN echo "export CUBELIBPATH=/root/centoscloud/cube-1.3/cubelib" >> /home/player/.bashrc
RUN echo "export CUBESYSPATH=/root/centoscloud/cube-1.3/proc" >> /home/player/.bashrc
RUN echo "export LD_LIBRARY_PATH=/root/centoscloud/cube-1.3/cubelib/lib" >> /home/player/.bashrc
RUN echo "export CUBE_BASE_DEFINE=/root/centoscloud/cube-1.3/proc/main/base_define" >> /home/player/.bashrc
RUN echo "export CUBE_DEFINE_PATH=/root/centoscloud/cube-1.3/proc/define" >> /home/player/.bashrc
RUN echo "export CUBE_SYS_PLUGIN=/root/centoscloud/cube-1.3/proc/plugin" >> /home/player/.bashrc

RUN echo "export CUBE_PATH=/root/centoscloud/cube-1.3" >> /root/.bashrc
RUN echo "export CUBELIBPATH=/root/centoscloud/cube-1.3/cubelib" >> /root/.bashrc
RUN echo "export CUBESYSPATH=/root/centoscloud/cube-1.3/proc" >> /root/.bashrc
RUN echo "export LD_LIBRARY_PATH=/root/centoscloud/cube-1.3/cubelib/lib" >> /root/.bashrc
RUN echo "export CUBE_BASE_DEFINE=/root/centoscloud/cube-1.3/proc/main/base_define" >> /root/.bashrc
RUN echo "export CUBE_DEFINE_PATH=/root/centoscloud/cube-1.3/proc/define" >> /root/.bashrc
RUN echo "export CUBE_SYS_PLUGIN=/root/centoscloud/cube-1.3/proc/plugin" >> /root/.bashrc
